<% pages_count = element_pages_count elements_count %>
<% if pages_count == 1 %>
  <h4 class="fs-5">
    <%= t ".#{type.pluralize}_title" %>
    <span class="badge count-number">
      <%= elements_count %>
    </span>
  </h4>
<% elsif pages_count > 1 %>
  <h4 class="fs-5">
    <%= t ".#{type.pluralize}_title" %>
    <%= link_to "##{type}-pagination-active-page-item", :class => "numbered_pagination_link badge count-number" do %>
      <%= t ".range", **element_range_values(elements_count, current_page) %>
    <% end %>
  </h4>

  <%= numbered_pagination(pages_count, "#{type}-pagination-active-page-item", :active_page => current_page) do |page|
        { :href => url_for("#{type}_page" => page),
          :title => t(".#{type.pluralize}_paginated", **element_range_values(elements_count, page)),
          :data => { :turbo => "true" } }
      end %>
<% end %>
